package com.yswy.backstage.utils;

import com.yswy.backstage.entity.user.User;

import javax.servlet.http.HttpServletRequest;

/**
 * token工具类
 * @author 周林
 */
public class GldTokenUtils {

    public static User getUser(HttpServletRequest request) {
        User user = (User) request.getSession().getAttribute("user");
        return user;
    }

    public static Long getUserId(HttpServletRequest request) {
        return Long.valueOf(getUser(request).getId());
//        return 1L;
    }
    public static String getUserPhone(HttpServletRequest request) {
        return getUser(request).getUserPhone();
    }
}
